package me.zk.practice1.hw;

/**
 * @author zhangkai
 * @date 2023/8/3 11:42
 */
public class S5 {

    public static void question(int[] nums){

        for (int i = 0; i <nums.length; i++) {
            int sum1= 0;
            int sum2 = 0;
            for (int j = 0; j < i; j++) {
                sum1+= nums[j];
            }
            for (int j = nums.length-1; j >=i+1 ; j--) {
                sum2 += nums[j];
            }
           if (sum1 == sum2) {
               System.out.println(i);
               break;
           }

        }
    }

    public static void main(String[] args) {
        question(new int[]{2,5,-1,8,6});
    }
}
